{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "6dd61309",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd,xlwings as xw"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ea20dffa",
   "metadata": {},
   "source": [
    "# 原始数据导入与预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "35b5893a",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 原始数据导入与预处理\n",
    "wbook1= xw.Book(r\"j:\\王振洋资料\\2.商贸分公司资料\\9月商贸分公司资料\\20240831代理家政（已开票）.xlsx\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "54eae2ed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>8月家政物料发货明细</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>日期</td>\n",
       "      <td>城市名称</td>\n",
       "      <td>商品名称</td>\n",
       "      <td>数量</td>\n",
       "      <td>单价</td>\n",
       "      <td>金额</td>\n",
       "      <td>尺码备注</td>\n",
       "      <td>快递单号</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2024-08-02 00:00:00</td>\n",
       "      <td>郑州</td>\n",
       "      <td>油烟机粉（到家）</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>None</td>\n",
       "      <td>极兔JT0012749238777</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>厨房清洁剂（到家）</td>\n",
       "      <td>1.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>None</td>\n",
       "      <td>None</td>\n",
       "      <td>伸缩拖把（到家）</td>\n",
       "      <td>1.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>None</td>\n",
       "      <td>极兔JT0012779528862</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     0     1          2     3     4     5     6  \\\n",
       "0           8月家政物料发货明细  None       None  None  None  None  None   \n",
       "1                   日期  城市名称       商品名称    数量    单价    金额  尺码备注   \n",
       "2  2024-08-02 00:00:00    郑州   油烟机粉（到家）   1.0   5.0   5.0  None   \n",
       "3                 None  None  厨房清洁剂（到家）   1.0   5.0   5.0  None   \n",
       "4                 None  None   伸缩拖把（到家）   1.0  24.0  24.0  None   \n",
       "\n",
       "                   7  \n",
       "0               None  \n",
       "1               快递单号  \n",
       "2  极兔JT0012749238777  \n",
       "3               None  \n",
       "4  极兔JT0012779528862  "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 导入数据并读取到dataframe\n",
    "原始数据源sheet='供应商发货明细'\n",
    "df1=wbook1.sheets(原始数据源sheet).range(\"a1\").current_region.options(pd.DataFrame,header=False,index=False).value\n",
    "df1.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "1d03e4d3",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 完善 index、column、填充缺失值等清理数据\n",
    "\n",
    "df1.columns=df1.iloc[1]  # 将第二行用作标题\n",
    "\n",
    "df2=df1[2:]  #从第4行开始读取数据，等于删除了0,1,2，三行\n",
    "df2.loc[:,'日期']=df2['日期'].fillna(method='ffill') # 填充日期列\n",
    "df2.loc[:,'日期']=df2['日期'].astype('str').str.replace('00:00:00','')\n",
    "df2.loc[:,'城市名称']=df2['城市名称'].fillna(method='ffill')  #填充城市名称列\n",
    "\n",
    "\n",
    "df2=df2.loc[:,['日期','城市名称','商品名称','数量','金额']]\n",
    "\n",
    "df2.head()\n",
    "df2.to_clipboard()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "f10afb38",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>1</th>\n",
       "      <th>城市名称</th>\n",
       "      <th>商品名称</th>\n",
       "      <th>数量</th>\n",
       "      <th>金额</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>大理</td>\n",
       "      <td>伸缩杆（到家）</td>\n",
       "      <td>5.0</td>\n",
       "      <td>60.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>大理</td>\n",
       "      <td>保洁背包（到家）</td>\n",
       "      <td>10.0</td>\n",
       "      <td>550.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>大理</td>\n",
       "      <td>地板擦（到家）</td>\n",
       "      <td>5.0</td>\n",
       "      <td>60.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>大理</td>\n",
       "      <td>瓷砖刷（到家）</td>\n",
       "      <td>5.0</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>郑州</td>\n",
       "      <td>一次性防尘膜（到家）</td>\n",
       "      <td>3.0</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "1 城市名称        商品名称    数量     金额\n",
       "0   大理     伸缩杆（到家）   5.0   60.0\n",
       "1   大理    保洁背包（到家）  10.0  550.0\n",
       "2   大理     地板擦（到家）   5.0   60.0\n",
       "3   大理     瓷砖刷（到家）   5.0   65.0\n",
       "4   郑州  一次性防尘膜（到家）   3.0   15.0"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df3=df2.groupby(by=[\"城市名称\",\"商品名称\"])[[\"数量\",\"金额\"]].sum().reset_index()\n",
    "df3.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "74d16f21",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 写入到工作表\n",
    "\n",
    "wbook1.sheets('编码匹配中间表').cells.clear()\n",
    "wbook1.sheets('编码匹配中间表').cells.number_format = '@' # 将单元格的数据格式设置为文本\n",
    "wbook1.sheets('编码匹配中间表').range('a1').value=df3"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "652ad4d7",
   "metadata": {},
   "source": [
    "# 编码匹配中间表"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "90af35d1",
   "metadata": {},
   "source": [
    "## 匹配仓库、部门、客户、存货编码、科目 等 各项内容\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "84eba7bb",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 打开t+基础数据表并写入相关数据，为匹配做准备\n",
    "wb基础数据=xw.Book(r'J:\\王振洋资料\\2.商贸分公司资料\\t+基础数据金水分.xlsx')\n",
    "往来存货档案=wb基础数据.sheets('往来单位匹配汇总-家政代驾').range('a1').expand().options(pd.DataFrame,index=False).value\n",
    "存货档案=wb基础数据.sheets('存货档案').range('a1').expand().options(pd.DataFrame,index=False).value\n",
    "存货档案=存货档案.loc[:,['存货编码','存货名称','计量单位','收入科目编码','收入科目名称']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "441a30ab",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 匹配 存货编码、仓库编码、部门编码等\n",
    "合并=pd.merge(df3,往来存货档案,left_on='城市名称',right_on='城市',how='left')\n",
    "合并=pd.merge(合并,存货档案,left_on='商品名称',right_on='存货名称',how='left')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "99603a77",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>城市名称</th>\n",
       "      <th>商品名称</th>\n",
       "      <th>数量</th>\n",
       "      <th>金额</th>\n",
       "      <th>城市</th>\n",
       "      <th>往来单位编码</th>\n",
       "      <th>往来单位名称</th>\n",
       "      <th>仓库编码</th>\n",
       "      <th>仓库名称</th>\n",
       "      <th>仓库名称2</th>\n",
       "      <th>存货编码</th>\n",
       "      <th>存货名称</th>\n",
       "      <th>计量单位</th>\n",
       "      <th>收入科目编码</th>\n",
       "      <th>收入科目名称</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>大理</td>\n",
       "      <td>伸缩杆（到家）</td>\n",
       "      <td>5.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>大理</td>\n",
       "      <td>S001161</td>\n",
       "      <td>大理家政代理商</td>\n",
       "      <td>168</td>\n",
       "      <td>大理家政代理商</td>\n",
       "      <td>大理</td>\n",
       "      <td>010143</td>\n",
       "      <td>伸缩杆（到家）</td>\n",
       "      <td>个</td>\n",
       "      <td>50010138</td>\n",
       "      <td>伸缩杆（到家）收入</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>大理</td>\n",
       "      <td>保洁背包（到家）</td>\n",
       "      <td>10.0</td>\n",
       "      <td>550.0</td>\n",
       "      <td>大理</td>\n",
       "      <td>S001161</td>\n",
       "      <td>大理家政代理商</td>\n",
       "      <td>168</td>\n",
       "      <td>大理家政代理商</td>\n",
       "      <td>大理</td>\n",
       "      <td>010101</td>\n",
       "      <td>保洁背包（到家）</td>\n",
       "      <td>个</td>\n",
       "      <td>50010101</td>\n",
       "      <td>保洁背包（到家）收入</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>大理</td>\n",
       "      <td>地板擦（到家）</td>\n",
       "      <td>5.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>大理</td>\n",
       "      <td>S001161</td>\n",
       "      <td>大理家政代理商</td>\n",
       "      <td>168</td>\n",
       "      <td>大理家政代理商</td>\n",
       "      <td>大理</td>\n",
       "      <td>010142</td>\n",
       "      <td>地板擦（到家）</td>\n",
       "      <td>个</td>\n",
       "      <td>50010139</td>\n",
       "      <td>地板擦（到家）收入</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>大理</td>\n",
       "      <td>瓷砖刷（到家）</td>\n",
       "      <td>5.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>大理</td>\n",
       "      <td>S001161</td>\n",
       "      <td>大理家政代理商</td>\n",
       "      <td>168</td>\n",
       "      <td>大理家政代理商</td>\n",
       "      <td>大理</td>\n",
       "      <td>010145</td>\n",
       "      <td>瓷砖刷（到家）</td>\n",
       "      <td>个</td>\n",
       "      <td>50010140</td>\n",
       "      <td>瓷砖刷（到家）收入</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>郑州</td>\n",
       "      <td>一次性防尘膜（到家）</td>\n",
       "      <td>3.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>郑州</td>\n",
       "      <td>S001043</td>\n",
       "      <td>乔松敏</td>\n",
       "      <td>001</td>\n",
       "      <td>郑州</td>\n",
       "      <td>郑州</td>\n",
       "      <td>010123</td>\n",
       "      <td>一次性防尘膜（到家）</td>\n",
       "      <td>卷</td>\n",
       "      <td>50010123</td>\n",
       "      <td>一次性防尘膜（到家）收入</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  城市名称        商品名称    数量     金额  城市   往来单位编码   往来单位名称 仓库编码     仓库名称 仓库名称2  \\\n",
       "0   大理     伸缩杆（到家）   5.0   60.0  大理  S001161  大理家政代理商  168  大理家政代理商    大理   \n",
       "1   大理    保洁背包（到家）  10.0  550.0  大理  S001161  大理家政代理商  168  大理家政代理商    大理   \n",
       "2   大理     地板擦（到家）   5.0   60.0  大理  S001161  大理家政代理商  168  大理家政代理商    大理   \n",
       "3   大理     瓷砖刷（到家）   5.0   65.0  大理  S001161  大理家政代理商  168  大理家政代理商    大理   \n",
       "4   郑州  一次性防尘膜（到家）   3.0   15.0  郑州  S001043      乔松敏  001       郑州    郑州   \n",
       "\n",
       "     存货编码        存货名称 计量单位    收入科目编码        收入科目名称  \n",
       "0  010143     伸缩杆（到家）    个  50010138     伸缩杆（到家）收入  \n",
       "1  010101    保洁背包（到家）    个  50010101    保洁背包（到家）收入  \n",
       "2  010142     地板擦（到家）    个  50010139     地板擦（到家）收入  \n",
       "3  010145     瓷砖刷（到家）    个  50010140     瓷砖刷（到家）收入  \n",
       "4  010123  一次性防尘膜（到家）    卷  50010123  一次性防尘膜（到家）收入  "
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "合并.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d8932541",
   "metadata": {},
   "source": [
    "## 将数据写入到编码匹配中间表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "3858e303",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 将合并写入<编码匹配中间表>\n",
    "\n",
    "# 创建一个sheet名字构建的列表，用于后续判断\n",
    "sheet_name=[wbook1.sheets[i].name for i in range(wbook1.sheets.count)]\n",
    "# 将数据写入到编码匹配中间表，对匹配失败的数据手动补充\n",
    "if '编码匹配中间表' in sheet_name:\n",
    "    ws=wbook1.sheets('编码匹配中间表')\n",
    "    ws.cells.clear()\n",
    "    ws.cells.number_format = '@'\n",
    "    ws.range('a1').value=合并\n",
    "else:\n",
    "    new_sheet=wbook1.sheets.add('编码匹配中间表')\n",
    "    new_sheet.cells.number_format = '@'\n",
    "    new_sheet.range('a1').value=合并\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "03633af2",
   "metadata": {},
   "source": [
    "# 手动在编码匹配中间表中补充相关数据\n",
    "1. 未能匹配到的数据\n",
    "2. 添加部门信息，除郑州的家政物料外，其余的部门均为招商部\n",
    "3. 添加供应商信息，根据实际的供应商添加"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "90455bcc",
   "metadata": {},
   "source": [
    "# 数据从编码匹配中间表--->模版数据源表\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "29763780",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 压缩数据\n",
    "# 将读取后的数据 进行压缩、汇总、透视，并生成备注列\n",
    "df1=wbook1.sheets('编码匹配中间表').range('a1').expand().options(pd.DataFrame).value\n",
    "\n",
    "df2=df1.groupby(by=['部门编码','部门','仓库编码','仓库名称','存货编码','存货名称','计量单位','供应商编码','供应商'])[['数量','金额']].sum().reset_index()\n",
    "df2['城市2']=df2['仓库名称'].str.replace('代理商','')  #将代理商三个字符替代为空\n",
    "\n",
    "df2['数量2']=df2['数量'].astype(str).str.replace('.0','')  # 新增一个数量2列，转化为文本并替换其中的.0，方便后续做文本链接\n",
    "df2['备注'] = df2['城市2'] + '购入'  + df2['数量2'] + df2['存货名称']  #增加一个备注列\n",
    "df2=df2.drop('数量2',axis=1)     #删除数量2列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "e526c648",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 添加汇总备注的函数，有了这个之后，备注可以按城市共用一个.\n",
    "def 添加汇总备注(x):\n",
    "    x['备注2'] = '+'.join(x['备注'].values)\n",
    "    x=x.drop('备注',axis=1)\n",
    "    return x\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "68a27ac1",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "df3=df2.groupby(by=['城市2']).apply(添加汇总备注)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3321b247",
   "metadata": {},
   "source": [
    "# 模版数据源表\n",
    "在编码匹配中间表补充好数据的编码、科目等数据信息等后，就可以将数据粘贴到模版数据源表，并进一步补充“不含税金额”，“税额”，“往来单位等”。补充完成后，以模版数据源为基础，生成销售出库单和凭证导入导出表中的数据\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "3e47f7a0",
   "metadata": {},
   "outputs": [],
   "source": [
    "wbook1.sheets('模版数据源').cells.number_format='@'\n",
    "wbook1.sheets('模版数据源').range('a1').value=df3.reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "ccf7347c",
   "metadata": {},
   "outputs": [],
   "source": [
    "入库单模版Paht=R'J:\\王振洋资料\\2.商贸分公司资料\\商贸分导入模板\\采购入库单.xlsx'\n",
    "\n",
    "sheetname = wbook1.sheet_names\n",
    "\n",
    "if '采购入库单' not in sheetname:\n",
    "    入库单=xw.Book(入库单模版Paht)\n",
    "    入库单.sheets['采购入库单'].copy(after=wbook1.sheets[wbook1.sheets.count-1])\n",
    "    入库单.close()\n",
    "else:\n",
    "    None"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "697b2edc",
   "metadata": {},
   "source": [
    "## 数据写入到采购入库单"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "3664fc73",
   "metadata": {},
   "outputs": [],
   "source": [
    "ws2=wbook1.sheets('采购入库单')\n",
    "ws3=wbook1.sheets('模版数据源')\n",
    "df4=ws3.range('a1').expand().options(pd.DataFrame).value\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "67051f2c",
   "metadata": {},
   "outputs": [],
   "source": [
    "ws2.range('a5:aa10000').clear_contents()\n",
    "ws2.range('g3:j3').value=df4.loc[:,['供应商编码','供应商','部门编码','部门']].values\n",
    "ws2.range('m3:o3').value=df4.loc[:,['备注2','仓库编码','仓库名称']].values\n",
    "ws2.range('r3:s3').value=df4.loc[:,['存货编码','存货名称']].values\n",
    "ws2.range('u3:v3').value=df4.loc[:,['计量单位','数量']].values\n",
    "ws2.range('Y3').value=0.00\n",
    "ws2.range('z3').options(transpose=True).value=df4['金额'].values\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
